package org.example.view.componet;


import javax.swing.*;
import java.awt.*;

public class ATMButton extends JButton {

    public ATMButton(ButtonTypeEnum name, int x, int y) {
        String fileName = switch (name) {
            case 取款 -> "/Users/cengyunke/Desktop/atm1/ATMGUI/src/main/java/org/example/img/buttonGet.jpg";
            case 清除 -> "/Users/cengyunke/Desktop/atm1/ATMGUI/src/main/java/org/example/img/buttonClear.jpg";
            case 查询 -> "/Users/cengyunke/Desktop/atm1/ATMGUI/src/main/java/org/example/img/buttonFind.jpg";
            case 登陆 -> "/Users/cengyunke/Desktop/atm1/ATMGUI/src/main/java/org/example/img/buttonLogin.jpg";
            case 改密 -> "/Users/cengyunke/Desktop/atm1/ATMGUI/src/main/java/org/example/img/buttonModify.jpg";
            case 退出 -> "/Users/cengyunke/Desktop/atm1/ATMGUI/src/main/java/org/example/img/buttonOff.jpg";
            case 注册 -> "/Users/cengyunke/Desktop/atm1/ATMGUI/src/main/java/org/example/img/buttonRegister.jpg";
            case 存款 -> "/Users/cengyunke/Desktop/atm1/ATMGUI/src/main/java/org/example/img/buttonSave.jpg";
            case 确定 -> "/Users/cengyunke/Desktop/atm1/ATMGUI/src/main/java/org/example/img/buttonSure.jpg";
            default -> "";
        };
        this.setIcon(new ImageIcon(fileName));
        this.setBounds(x, y, 140, 50);
    }

}
